home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / allfiles / Centri / Centri.dir / 00291_Script_Orbiter < prev    next >
Text File  |  1999-02-25  |  2KB  |  109 lines

  1. --Code by Renfield Feinstein (ren@core-ad.co.jp)
  2.  
  3. -- The Orbital Behavor as hacked by Renfield
  4. -- ren@core-ad.co.jp
  5. -- with respect to flat earth communications
  6.  
  7.  
  8. property spriteNum
  9. property orbitSpeed, originH, originV, radiusH, radiusV, originType, originSprite
  10.  
  11. --======  The Set Up:
  12.  
  13. on idle me
  14.   checkOrigin me
  15.   orbit me
  16.   updateStage
  17. end
  18.  
  19. on exitFrame me
  20.   checkOrigin me
  21.   orbit me
  22. end
  23.  
  24.  
  25.  
  26. --======  Making Biscuits:
  27.  
  28. on checkOrigin me
  29.   case (originType) of
  30.     "mouse": mouseOrigin me
  31.     "sprite": spriteOrigin me
  32.   end case
  33. end
  34.  
  35. on mouseOrigin me
  36.   set originH = the mouseh
  37.   set originV = the mousev
  38. end
  39.  
  40. on spriteOrigin
  41.   set originH = the loch of sprite originSprite
  42.   set originV = the locv of sprite originSprite
  43. end
  44.  
  45.  
  46. on orbit me
  47.   set counter to the ticks
  48.   set the loch of sprite spriteNum  = originH + radiusH * cos(counter/orbitSpeed)
  49.   set the locv of sprite spriteNum  = originV +radiusV * sin(counter/orbitSpeed)
  50. end
  51.  
  52. --======  Behavior Handlers:
  53.  
  54. on getPropertyDescriptionList me
  55.   set theProps to [:]
  56.   
  57.   set c to "What's the orbit speed?"
  58.   set f to #float
  59.   set d to 50.00
  60.   addProp theProps, #orbitSpeed, [#comment: c, #format: f, #default: d]
  61.   
  62.   set c to "What's the origin?"
  63.   set f to #string
  64.   set r to ["point", "mouse", "sprite"]
  65.   set d to getAt(r,1)
  66.   set typeProps to [#comment: c, #format: f, #range: r, #default: d]
  67.   addProp theProps, #originType, typeProps
  68.   
  69.   set c to "If origin is a sprite, who?"
  70.   set f to #integer
  71.   set d to 1
  72.   addProp theProps, #originSprite, [#comment: c, #format: f, #default: d]
  73.   
  74.   set c to "If origin is a point, what's H?"
  75.   set f to #integer
  76.   set d to 100
  77.   addProp theProps, #originH, [#comment: c, #format: f, #default: d]
  78.   
  79.   set c to "if origin is a point,what's V?"
  80.   set f to #integer
  81.   set d to 100
  82.   addProp theProps, #originV, [#comment: c, #format: f, #default: d]
  83.   
  84.   
  85.   set c to "What's the H radius?"
  86.   set f to #integer
  87.   set d to 30
  88.   addProp theProps, #radiusH, [#comment: c, #format: f, #default: d]
  89.   
  90.   set c to "What's the V radius?"
  91.   set f to #integer
  92.   set d to 30
  93.   addProp theProps, #radiusV, [#comment: c, #format: f, #default: d]
  94.   
  95.   return theProps
  96. end
  97.  
  98.  
  99. on getBehaviorDescription me
  100.   set line1 to " Make an orbiter" & RETURN
  101.   return line1
  102.             end
  103.  
  104.  
  105.  
  106.             --======
  107.             --======
  108.  
  109.